package com.appspot.yozmcup;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.http.*;

import oauth.signpost.OAuthConsumer;
import oauth.signpost.basic.DefaultOAuthConsumer;

import com.appspot.yozmcup.DAO.YozmDAO;
import com.google.appengine.repackaged.org.json.JSONObject;

@SuppressWarnings("serial")
public class CheckNickServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
		HttpSession session = req.getSession();
		String nickname = req.getParameter("nickname");
		String result = YozmDAO.getAvailableNickname(nickname);
		res.setContentType("text/xml");
		res.setCharacterEncoding("UTF-8");
        res.getWriter().write(result);
	}
}
